package com.mzkj.wanjulaile.mobile.api.modules.toy.mapper;

import com.mzkj.wanjulaile.mobile.api.modules.toy.entity.Toy;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by wangxw on 16/7/26.
 */
@Repository
public interface ToyMapper {
    /**
     * 根据玩具名称查询玩具
     *
     * @param toy toy实体
     * @return
     */
    Toy getByToyCode(Toy toy);

    /**
     * @param code 玩具编码
     * @return
     */
    @Select("SELECT id, `name`, code FROM toy where code = #{code}")
    Toy getToy(String code);

//    @Select("select id, `name`, code from toy")
//    List<Toy> findList();

    int update(Toy toy);

    Toy get(Toy toy);
    Toy get(String id);

    List<Toy> getNewProduct(int pageSize);


    List<Toy> getHomeToyList(Toy toy);


    Toy getById(Toy toy);

    List<Toy> getByIds(List<String> ids);

    List<Toy> getListByType(Toy toy);

    List<Toy> findToyList(Toy toy);

    List<Toy> findAllList(Toy toy);

    void updateParams(Toy toy);

    Toy getToyByCode(Toy toy);

    int getAllCount(Toy toy);
}
